package cn.bluedot.tea.service;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;

import cn.bluedot.framework.annotations.Dispatcher;
import cn.bluedot.framework.annotations.RequestView;
import cn.bluedot.framework.annotations.ResponseJson;
import cn.bluedot.framework.annotations.Service;
import cn.bluedot.framework.service.BaseService;
import cn.bluedot.framework.web.Result;
import cn.bluedot.tea.dao.BaseDao;
import cn.bluedot.tea.pojo.domain.DryRealTimeData;
import cn.bluedot.tea.pojo.domain.DryStandard;
import cn.bluedot.tea.pojo.domain.FixationRecord;
import cn.bluedot.tea.pojo.domain.FixationStandard;
import cn.bluedot.tea.pojo.domain.PackRecord;
import cn.bluedot.tea.pojo.domain.PackStandard;
import cn.bluedot.tea.pojo.domain.Standard;
import cn.bluedot.tea.pojo.domain.TeaCategory;
import cn.bluedot.tea.pojo.domain.TwistRecord;
import cn.bluedot.tea.pojo.domain.TwistStandard;
import cn.bluedot.tea.pojo.domain.User;
import cn.bluedot.tea.pojo.vo.PackStandardVo;
import cn.bluedot.tea.pojo.vo.TransportStandardVo;
import cn.bluedot.tea.util.Page;
import cn.bluedot.tea.util.PageBean;

@Service // 注释这是一个service，必须
public class ProductionService extends BaseService {
	public ProductionService() {
	} // 无参构造函数

	/**
	 * 有参构造函数 ，必须
	 * 
	 * @param uri
	 * @param params
	 * @param data
	 */
	public ProductionService(String uri, Map<String, Object[]> params, Map<String, Object> data) {
		super(params, data); // 调用父类有参构造，必须
		execute(uri, params, data); // 执行业务，调用父类方法
	}

	// sidebar处发过来的请求，用于处理生产记录部分的公共分页
	@RequestView(uri = "/production/record/getProductionRecord", view = "") // 第一个参数为前端请求URI,第二个参数对应sql.xml里的view中的name属性
	@Dispatcher(success = "/production/record", failed = "/error")
	private void getProductionRecord(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params);
		String num = (String) param.get("pagenum");
		param.remove("pagenum");
		int pagenum = num == null ? 1 : Integer.parseInt(num);
		Page.startPage(pagenum, 10);
		getFixationRecord(params, data);
		listTwistRecord(params, data);
		getDryRecord(params, data);
		getPackRecord(params, data);
		List<?> query = new ArrayList();
		query.addAll((List) data.get("queryFixation"));
		query.addAll((List) data.get("queryTwist"));
		query.addAll((List) data.get("queryDry"));
		query.addAll((List) data.get("queryPack"));
		
		

		PageBean<?> pageBean = new PageBean<>(query, 10);
		data.put("query", pageBean);
	}

	// sidebar处发过来的请求，用于处理生产标准部分的公共分页
	@RequestView(uri = "/production/norm/getProductionStandard") // 第一个参数为前端请求URI,第二个参数对应sql.xml里的view中的name属性
	@Dispatcher(success = "/production/norm", failed = "/error")
	private void getProductionStandard(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params);
		String num = (String) param.get("pagenum");
		param.remove("pagenum");
		int pagenum = num == null ? 1 : Integer.parseInt(num);

		Page.startPage(pagenum, 10);
		getFixationStandard(params, data);
		listTwistStandard(params, data);
		queryDryStandard(params, data);
		queryPackStandard(params, data);

		List<?> query = new ArrayList();
		query.addAll((List) data.get("queryFixation"));
		query.addAll((List) data.get("queryTwist"));
		query.addAll((List) data.get("queryDry"));
		query.addAll((List) data.get("queryPack"));

		PageBean<?> pageBean = new PageBean<>(query, 10);
		data.put("query", pageBean);

	}

	/**
	 * 查询标准详情 前端发送请求过来，在此处进行生产流程判断，然后调用相应流程的查询方法
	 * 
	 * @param params
	 * @param data
	 */
	@RequestView(uri = "/production/standard/queryStandardDetail", view = "")
	@ResponseJson
	public void queryStandardDetail(Map<String, Object[]> params, Map<String, Object> data) throws Exception {

		Map<String, Object> param = getParameterMap(params);
		String standardId = (String) param.get("standardId");
		char head = standardId.charAt(0);
		int standardIdLength = standardId.length();
		if (standardIdLength <= 8) {
			// 杀青
			getFixationStandardByTeaName(params, data);
			return;
		} else {
			 if (head == '1') {
					// 揉捻
					getStandardByStandardId(params, data);
					return;
				} else if (head == '2') {
					// 干燥
					queryDryStandardDetail(params, data);
					return;
				} else if (head == '3') {
					// 打包
					getStandardByPackStandardId(params, data);
					return;
				} 
		}
			data.put("Result", Result.FAILED);
			data.put("message", "详情查询失败！");
	}

	/**
	 * 查询记录详情 流程与查询标准详情一致
	 * 
	 * @param params
	 * @param data
	 */
	@RequestView(uri = "/production/record/queryRecordByProductBatch", view = "")
	@ResponseJson
	public void queryRecordByProductBatch(Map<String, Object[]> params, Map<String, Object> data) throws Exception {

		Map<String, Object> param = getParameterMap(params);
		String standardId = (String) param.get("productBatch");
		char head = standardId.charAt(0);

		if (head == 'F') {
			// 杀青
			getFixationRecordByProductBatch(params, data);
		} else if (head == 'T') {
			// 揉捻
			getTwistRecordByProductBatch(params, data);

		} else if (head == 'D') {
			// 干燥
			getDryRecordByID(params, data);
		} else if (head == 'P') {
			// 打包
			getPackRecordByProductBatch(params, data);
		} else {
			data.put("Result", Result.FAILED);
			data.put("message", "详情查询失败！");
		}
	}

	// 删除标准，共用方法
	@RequestView(uri = "/production/standard/deleteStandardByID", view = "deleteStandardByID") // 第一个参数为前端请求URI,第二个参数对应sql.xml里的view中的name属性
	@ResponseJson
	private void deleteStandardByID(Map<String, Object[]> params, Map<String, Object> data) throws Exception {

		Map<String, Object> param = getParameterMap(params);

		Standard query = (Standard) BaseDao.excuteQuery(param, Standard.class);

		if (query == null) {
			data.put("message", "标准" + param.get("standardId") + "不存在！");
			data.put("Result", Result.FAILED);
			return;
		}

		// 删除t_standard部分，因为有外键及删除关联，所以t_***_standard部分会一起删除
		int excute = BaseDao.excute(param);

		if (excute > 0) {
			data.put("message", "标准" + param.get("standardId") + "删除成功！");
			data.put("Result", Result.SUCCESS);
		} else {
			data.put("message", param.get("standardId") + "标准删除失败，请重试！");
			data.put("Result", Result.FAILED);
		}
	}

	/**
	 * 根据生产批次查询杀青记录
	 * 
	 * @param params
	 * @param data
	 * @throws Exception
	 */
	@RequestView(uri = "/production/record/getFixationRecordByProductBatch", view = "getFixationRecordByProductBatch") // 第一个参数为前端请求URI,第二个参数对应sql.xml里的view中的name属性
	@ResponseJson
	private void getFixationRecordByProductBatch(Map<String, Object[]> params, Map<String, Object> data)
			throws Exception {

		Map<String, Object> param = getParameterMap(params);
		param.put("view", "getFixationRecordByProductBatch");
		FixationRecord FixationRecord = (FixationRecord) BaseDao.excuteQuery(param, FixationRecord.class);

		if (FixationRecord == null) {
			data.put("RESULT", Result.FAILED);
			data.put("message", "查找的记录不存在");
		} else {
			data.put("RESUTL", Result.SUCCESS);
			data.put("record", FixationRecord);
		}
	}

	/**
	 * 获取所有杀青记录
	 * 
	 * @param params
	 * @param data
	 * @throws Exception
	 */
	@RequestView(uri = "/production/record/getFixatRecord", view = "getFixationRecord")
	@ResponseJson
	private void getFixationRecord(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		try {
			Map<String, Object> param = getParameterMap(params); // 将数组值转为单个值
			param.put("view", "getFixationRecord");
			List query = (List) BaseDao.excuteQuery(param, null);
			data.put("queryFixation", query);
			data.put("type", "杀青");
			data.put("RESULT", Result.SUCCESS);
		} catch (Exception e) {
			data.put("message", "修改失败");
			throw new RuntimeException(e);
		}
	}

	/**
	 * 添加杀青记录
	 * 
	 * @param params
	 * @param data
	 * @throws Exception
	 */
	@RequestView(uri = "/production/record/addFixationRecord", view = "addFixationRecord") // 第一个参数为前端请求URI,第二个参数对应sql.xml里的view中的name属性
	@ResponseJson
	private void addFixationRecord(Map<String, Object[]> params, Map<String, Object> data) throws Exception {

		Map<String, Object> param = getParameterMap(params);
		// 验证生产批次是否重复记录同一批次
		Object productBatch = param.get("productBatch");
		Map<String, Object> temp = new HashMap<String, Object>();
		temp.put("view", "selectFixationRecordCountByProductBatch");
		temp.put("productBatch", productBatch);
		int query = (int) BaseDao.excuteQuery(temp, null);

		if (query > 0) {
			data.put("message", "记录已存在，请检查批次号码是否写错！");
			data.put("Result", Result.FAILED);
			return;
		}

		Date date = new Date();
		DateFormat df = DateFormat.getDateTimeInstance();
		String datevalue = df.format(date);

		param.put("recordTime", datevalue);
		System.out.println(param);
		int excute = BaseDao.excute(param);
		if (excute > 0) {
			data.put("message", productBatch + "记录添加成功！");
			data.put("Result", Result.SUCCESS);
		} else {
			data.put("message", "记录添加失败，请重试！");
			data.put("Result", Result.FAILED);
		}
	}

	/**
	 * 删除杀青记录
	 * 
	 * @param params
	 * @param data
	 * @throws Exception
	 */
	@RequestView(uri = "/production/record/deleteFixationRecordByProductBatch", view = "deleteFixationRecordByProductBatch") // 第一个参数为前端请求URI,第二个参数对应sql.xml里的view中的name属性
	@ResponseJson
	private void deleteFixationRecordByProductBatch(Map<String, Object[]> params, Map<String, Object> data)
			throws Exception {

		Map<String, Object> param = getParameterMap(params);
		FixationRecord query = (FixationRecord) BaseDao.excuteQuery(param, FixationRecord.class);

		if (query == null) {
			data.put("message", "记录不存在！");
			data.put("Result", Result.FAILED);
			return;
		}

		int excute = BaseDao.excute(param);
		if (excute > 0) {
			data.put("message", "记录删除成功！");
			data.put("Result", Result.SUCCESS);
		} else {
			data.put("message", "记录删除失败，请重试！");
			data.put("Result", Result.FAILED);
		}
	}

	/**
	 * 获取所有杀青标准
	 * 
	 * @param params
	 * @param data
	 * @throws Exception
	 */
	@RequestView(uri = "/production/standard/getFixationStandard", view = "getFixationStandard")
	@ResponseJson
	private void getFixationStandard(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		try {
			Map<String, Object> param = getParameterMap(params); // 将数组值转为单个值
			param.put("view", "getFixationStandard");
			List query = (List) BaseDao.excuteQuery(param, null);
			data.put("queryFixation", query);
			data.put("type", "杀青");
			data.put("RESULT", Result.SUCCESS);
		} catch (Exception e) {
			data.put("message", "修改失败");
			throw new RuntimeException(e);
		}
	}

	/**
	 * 根据茶叶名称查询杀青标准
	 * 
	 * @param params
	 * @param data
	 * @throws Exception
	 */
	@RequestView(uri = "/production/standard/getFixationStandardByTeaName", view = "getFixationStandardByTeaName") // 第一个参数为前端请求URI,第二个参数对应sql.xml里的view中的name属性
	@ResponseJson
	private void getFixationStandardByTeaName(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params); // 将数组值转为单个值
		param.put("view", "getFixationStandardByTeaName");
		param.put("teaName", param.get("teaName"));
		param.put("standardId", param.get("standardId"));
		List query = (List) BaseDao.excuteQuery(param, null);
		data.put("standard", query.get(0));
	}
	/*private void getFixationStandardByTeaName(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params);

		// 查询t_fixation_standard中的参数，并得到standard_id
		param.put("view", "getFixationStandardByTeaName");
		FixationStandard fixationStandard = (FixationStandard) BaseDao.excuteQuery(param, FixationStandard.class);

		// 通过standard_id查询t_standard中的共有参数
		Map<String, Object> temp = new HashMap<String, Object>();
		temp.put("view", "getStandardByStandardId");
		temp.put("standardId", param.get("standardId"));

		Standard standard = (Standard) BaseDao.excuteQuery(temp, Standard.class);

		if (fixationStandard != null) {
			data.put("standard", fixationStandard);
			data.put("baseStandard", standard);
			data.put("RESULT", Result.SUCCESS);
		} else {
			data.put("message", param.get("teaName") + "标准查询失败！");
			data.put("RESULT", Result.FAILED);
		}
	}*/
	
	/**
	 * 添加杀青标准
	 * 
	 * @param params
	 * @param data
	 * @throws Exception
	 */
	@RequestView(uri = "/production/standard/addFixationStandard", view = "addFixationStandard") // 第一个参数为前端请求URI,第二个参数对应sql.xml里的view中的name属性
	@ResponseJson
	private void addFixationStandard(Map<String, Object[]> params, Map<String, Object> data) throws Exception {

		Map<String, Object> param = getParameterMap(params);
		// 验证生产批次是否重复记录同一茶叶
		Object teaName = param.get("teaName");
		Object fixationStage = param.get("fixationStage");
		Map<String, Object> temp = new HashMap<String, Object>();
		temp.put("view", "getFixationStandardCountByTeaName");
		temp.put("teaName", teaName);
		temp.put("fixationStage", fixationStage);
		int query = (int) BaseDao.excuteQuery(temp, null);

		if (query > 0) {
			data.put("message", "标准已存在！");
			data.put("Result", Result.FAILED);
			return;
		}
		StringBuilder str = new StringBuilder();//定义变长字符串
		Random random = new Random();
		//随机生成数字，并添加到字符串
		for(int i = 0; i < 8; i++){
		    str.append(random.nextInt(10));
		}
		int number = Integer.parseInt(str.toString());
		String standardId = "0" + number;
		// 添加t_standard部分
		temp.clear();
		temp.put("view", "addStandard");
		temp.put("temperatureStandard", param.get("temperatureStandard"));
		temp.put("timeStandard", param.get("timeStandard"));
		temp.put("waterStandard", param.get("waterStandard"));
		temp.put("speedStandard", param.get("speedStandard"));
		temp.put("leafStandard", param.get("leafStandard"));

		temp.put("standardId", standardId);

		int excute1 = BaseDao.excute(temp);

		Date date = new Date();
		DateFormat df = DateFormat.getDateTimeInstance();
		String datevalue = df.format(date);
		param.put("lastModifyTime", datevalue);
		param.put("standardId", standardId);
		System.out.println(standardId);
		int excute2 = BaseDao.excute(param);

		if (excute1 > 0 && excute2 > 0) {
			data.put("message", teaName + "标准添加成功！");
			data.put("Result", Result.SUCCESS);
		} else {
			data.put("message", "标准添加失败，请重试！");
			data.put("Result", Result.FAILED);
		}
	}

	// 获取分页揉捻记录

	@RequestView(uri = "/production/norm/listTwistRecord", view = "getTwistRecord") // 第一个参数为前端请求URI,第二个参数对应sql.xml里的view中的name属性
	@Dispatcher(success = "/production/standard", failed = "error")
	private void listTwistRecord(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params);

		param.put("view", "getTwistRecord");
		List<?> query = (List<?>) BaseDao.excuteQuery(param, null);

		data.put("queryTwist", query);
		data.put("RESULT", Result.SUCCESS);
	}

	// 获取分页揉捻标准
	@RequestView(uri = "/production/norm/listTwistStandard", view = "getTwistStandard") // 第一个参数为前端请求URI,第二个参数对应sql.xml里的view中的name属性
	/* @Dispatcher(success = "/production/standard", failed = "error") */
	private void listTwistStandard(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params);
		param.put("view", "getTwistStandard");

		List<?> query = (List<?>) BaseDao.excuteQuery(param, null);

		/* PageBean<?> pageBean = new PageBean<>(query, 10); */
		data.put("queryTwist", query);
		data.put("RESULT", Result.SUCCESS);
	}

	// 查询揉捻记录详情
	@RequestView(uri = "/production/record/getTwistRecordByProductBatch", view = "getTwistRecordByProductBatch") // 第一个参数为前端请求URI,第二个参数对应sql.xml里的view中的name属性
	@ResponseJson
	private void getTwistRecordByProductBatch(Map<String, Object[]> params, Map<String, Object> data) throws Exception {

		Map<String, Object> param = getParameterMap(params);
		param.put("view", "getTwistRecordByProductBatch");
		TwistRecord twistRecord = (TwistRecord) BaseDao.excuteQuery(param, TwistRecord.class);

		if (twistRecord == null) {
			data.put("RESULT", Result.FAILED);
			data.put("message", "记录" + param.get("productBatch") + "不存在");
		} else {
			data.put("RESUTL", Result.SUCCESS);
			data.put("record", twistRecord);
		}
	}

	// 查询标准详情
	@RequestView(uri = "/production/standard/getStandardByStandardId", view = "getStandardByStandardId") // 第一个参数为前端请求URI,第二个参数对应sql.xml里的view中的name属性
	@ResponseJson
	private void getStandardByStandardId(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params);

		// 查询t_twist_standard中的参数，并得到standard_id
		param.put("view", "getTwistStandardByName");
		TwistStandard twistStandard = (TwistStandard) BaseDao.excuteQuery(param, TwistStandard.class);

		// 通过standard_id查询t_standard中的共有参数
		Map<String, Object> temp = new HashMap<String, Object>();
		temp.put("view", "getStandardByStandardId");
		temp.put("standardId", param.get("standardId"));

		Standard standard = (Standard) BaseDao.excuteQuery(temp, Standard.class);

		if (twistStandard != null) {
			data.put("standard", twistStandard);
			data.put("baseStandard", standard);
			data.put("RESULT", Result.SUCCESS);
		} else {
			data.put("message", param.get("teaName") + "标准查询失败！");
			data.put("RESULT", Result.FAILED);
		}
	}

	// 查询单个揉捻标准（查询详情处调用）
	@RequestView(uri = "/production/standard/getTwistStandardByName", view = "getTwistStandardByName") // 第一个参数为前端请求URI,第二个参数对应sql.xml里的view中的name属性
	private void getTwistStandardByName(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params);

		TwistStandard twistStandard = (TwistStandard) BaseDao.excuteQuery(param, null);

		if (twistStandard != null) {
			data.put("standard", twistStandard);
			data.put("RESULT", Result.SUCCESS);
		} else {
			data.put("RESULT", Result.FAILED);
		}
	}

	// 添加揉捻记录
	@RequestView(uri = "/production/record/addTwistRecord", view = "addTwistRecord") // 第一个参数为前端请求URI,第二个参数对应sql.xml里的view中的name属性
	@ResponseJson
	private void addTwistRecord(Map<String, Object[]> params, Map<String, Object> data) throws Exception {

		Map<String, Object> param = getParameterMap(params);
		// 验证生产批次是否重复记录同一批次
		Object productBatch = param.get("productBatch");
		Map<String, Object> temp = new HashMap<String, Object>();
		temp.put("view", "selectTwistRecordCountById");
		temp.put("productBatch", productBatch);
		TwistRecord query = (TwistRecord) BaseDao.excuteQuery(temp, TwistRecord.class);

		if (query != null) {
			data.put("message", "记录" + productBatch + "已存在，请检查批次号码是否写错！");
			data.put("Result", Result.FAILED);
			return;
		}

		Date date = new Date();
		DateFormat df = DateFormat.getDateTimeInstance();
		String datevalue = df.format(date);

		param.put("recordTime", datevalue);
		int excute = BaseDao.excute(param);

		if (excute > 0) {
			data.put("message", "记录" + productBatch + "添加成功！");
			data.put("Result", Result.SUCCESS);
		} else {
			data.put("message", "记录" + productBatch + "添加失败，请重试！");
			data.put("Result", Result.FAILED);
		}
	}

	// 删除揉捻记录
	@RequestView(uri = "/production/record/deleteTwistRecordByProductBatch", view = "deleteTwistRecordByProductBatch") // 第一个参数为前端请求URI,第二个参数对应sql.xml里的view中的name属性
	@ResponseJson
	private void deleteTwistRecordByProductBatch(Map<String, Object[]> params, Map<String, Object> data)
			throws Exception {

		Map<String, Object> param = getParameterMap(params);
		TwistRecord query = (TwistRecord) BaseDao.excuteQuery(param, TwistRecord.class);

		if (query == null) {
			data.put("message", "记录" + param.get("productBatch") + "不存在！");
			data.put("Result", Result.FAILED);
			return;
		}

		int excute = BaseDao.excute(param);
		if (excute > 0) {
			data.put("message", "记录" + param.get("productBatch") + "删除成功！");
			data.put("Result", Result.SUCCESS);
		} else {
			data.put("message", "记录" + param.get("productBatch") + "删除失败，请重试！");
			data.put("Result", Result.FAILED);
		}
	}

	// 添加揉捻标准
	@RequestView(uri = "/production/standard/addTwistStandard", view = "addTwistStandard") // 第一个参数为前端请求URI,第二个参数对应sql.xml里的view中的name属性
	@ResponseJson
	private void addTwistStandard(Map<String, Object[]> params, Map<String, Object> data) throws Exception {

		Map<String, Object> param = getParameterMap(params);
		// 验证生产批次是否重复记录同一茶叶
		Object teaName = param.get("teaName");
		Map<String, Object> temp = new HashMap<String, Object>();
		temp.put("view", "getTwistStandardByName");
		temp.put("teaName", teaName);
		TwistStandard query = (TwistStandard) BaseDao.excuteQuery(temp, TwistStandard.class);

		if (query != null) {
			data.put("message", "标准已存在！");
			data.put("Result", Result.FAILED);
			return;
		}

		StringBuilder str = new StringBuilder();//定义变长字符串
		Random random = new Random();
		//随机生成数字，并添加到字符串
		for(int i = 0; i < 8; i++){
		    str.append(random.nextInt(10));
		}
		int number = Integer.parseInt(str.toString());
		String standardId = "1"  + number;
		System.out.println(standardId);
		// 添加t_standard部
		temp.clear();
		temp.put("view", "addStandard");
		temp.put("temperatureStandard", param.get("temperatureStandard"));
		temp.put("timeStandard", param.get("timeStandard"));
		temp.put("waterStandard", param.get("waterStandard"));
		temp.put("speedStandard", param.get("speedStandard"));
		temp.put("leafStandard", param.get("leafStandard"));
		temp.put("standardId", standardId);
		int excute1 = BaseDao.excute(temp);
		if (excute1 > 0) {
			Date date = new Date();
			DateFormat df = DateFormat.getDateTimeInstance();
			String datevalue = df.format(date);

			// 添加t_twist_standard部分
			param.put("standardId", standardId);
			param.put("lastModifyTime", datevalue);
			int excute2 = BaseDao.excute(param);
			if (excute2 > 0) {
				data.put("message", teaName + "标准添加成功！");
				data.put("Result", Result.SUCCESS);
			}
		} else {
			data.put("message", "标准添加失败，请重试！");
			data.put("Result", Result.FAILED);
		}
	}

	// 添加公共标准部分，在addTwistStandard处调用
	@RequestView(uri = "/production/standard/addStandard", view = "addStandard") // 第一个参数为前端请求URI,第二个参数对应sql.xml里的view中的name属性
	@ResponseJson
	private void addStandard(Map<String, Object[]> params, Map<String, Object> data) throws Exception {

		Map<String, Object> param = getParameterMap(params);
		Standard query = (Standard) BaseDao.excuteQuery(param, Standard.class);

		if (query != null) {
			data.put("message", "标准" + param.get("standardId") + "已存在！");
			data.put("Result", Result.FAILED);
			return;
		}

		int excute = BaseDao.excute(param);

		if (excute > 0) {
			data.put("message", "标准" + param.get("standardId") + "添加成功！");
			data.put("Result", Result.SUCCESS);
		} else {
			data.put("message", "标准" + param.get("standardId") + "添加失败，请重试！");
			data.put("Result", Result.FAILED);
		}
	}

	// 汤金桂 dry

	@RequestView(uri = "/production/addDryStandard", view = "addDryStandard")
	@ResponseJson
	private void addDryStandard(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		try {
			Date date = new Date();
			DateFormat simpleDateFormat2 = new SimpleDateFormat("yyyyMMdd");
			String today = simpleDateFormat2.format(date); // 格式化后的时间
			today = today.substring(2);
			System.out.println(today);
			String elseIdLike = "2" + today;
			Map<String, Object> queryElseIdMap = new HashMap();
			queryElseIdMap.put("view", "queryLastDryStandardtoday");
			queryElseIdMap.put("elseId", elseIdLike + "%");
			Map<String, Object> param = getParameterMap(params); // 将数组值转为单个值
			Object list = BaseDao.excuteQuery(queryElseIdMap, null, true);
			if (list instanceof java.lang.Integer) {
				int elseId = (int) list;
				param.put("view", "addStandard");
				param.put("standardId", elseId + 1);
				BaseDao.excute(param);
				DateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
				String lastModifyDate = simpleDateFormat.format(date);
				param.put("lastModifyTime", lastModifyDate);
				param.put("elseId", elseId + 1);
				param.put("view", "addDryStandard");
				BaseDao.excute(param);
			} else {
				param.put("view", "addStandardDryStandard");
				param.put("standardId", "2" + today + "00");
				BaseDao.excute(param);

				DateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
				String lastModifyDate = simpleDateFormat.format(date);
				param.put("lastModifyTime", lastModifyDate);
				param.put("elseId", "2" + today + "00");
				param.put("standerId", "2" + today + "00");
				param.put("view", "addDryStandard");
				BaseDao.excute(param);
			}
			data.put("message", "添加标准成功");
		} catch (Exception e) {
			System.out.println("bbbbbbbbbbbbbbbbbbbbbbbbb");
			data.put("message", "后台正在修复，请你稍后");
			throw new RuntimeException(e);
			// 日志处理
		}
	}

	// http://localhost:8080/updateDryStandard.do?standerId=7&elseId=1&teaName=lilibbbbb&fanSpeed=1&fanStatus=1&drumStatus=1&temperateStandard=1&timeStandard=1&waterStandard=1&speedStandard=1&leafStandard=4
	@RequestView(uri = "/production/updateDryStandard", view = "updateDryStandard")
	@ResponseJson
	private void updateDryStandard(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params); // 将数组值转为单个值
		Date date = new Date(); // 获取一个Date对象
		DateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 创建一个格式化日期对象
		String punchTime = simpleDateFormat.format(date); // 格式化后的时间
		if ("true".equals(param.get("isSelection"))) {
			param.put("isSelection", 1);
		} else {
			param.put("isSelection", 0);
		}
		param.put("lastModifyTime", punchTime);
		if ("true".equals(param.get("fanStatus"))) {
			param.put("fanStatus", 1);
		} else {
			param.put("fanStatus", 0);
		}
		if ("true".equals(param.get("drumStatus"))) {
			param.put("drumStatus", 1);
		} else {
			param.put("drumStatus", 0);
		}
		BaseDao.excute(param);
		param.put("view", "queryDryStandardByID");
		DryStandard dryStandard = (DryStandard) BaseDao.excuteQuery(param, DryStandard.class);

		param.put("view", "updateStandard");
		param.put("standardId", dryStandard.getElseId());
		BaseDao.excute(param);
		data.put("message", "恭喜您修改成功");
	}

	// http://localhost:8080/addDryRealTimeData.do?temperature=1&waterSpeed=0.1&operateBatch=1&fanSpeedn=1&drumSpeed=1&drumStatus=1&deviceId=2
	@RequestView(uri = "/production/addDryRealTimeData", view = "addDryRealTimeData")
	private void addDryRealTimeData(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params); // 将数组值转为单个值
		Date date = new Date(); // 获取一个Date对象
		DateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 创建一个格式化日期对象
		String punchTime = simpleDateFormat.format(date); // 格式化后的时间
		param.put("time", punchTime);
		BaseDao.excute(param);
	}

	// http://localhost:8080/addDryRecord.do?deliveryBatch=1&deviceId=1&producerId=1&weightLast=1
	@RequestView(uri = "/production/addDryRecord", view = "addDryRecord")
	@ResponseJson
	private void addDryRecord(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> paramUpdateRecord = getParameterMap(params); // 将数组值转为单个值
		Map<String, Object> paramQueryUser = paramUpdateRecord;
		paramQueryUser.put("view", "getUserById");
		paramQueryUser.put("userId", paramUpdateRecord.get("producerId"));
		User user = (User) BaseDao.excuteQuery(paramQueryUser, User.class);
		if (user == null) {
			data.put("message", "生产员编号有误，请您重新填写");
		} else {
			paramUpdateRecord.put("view", "addDryRecord");
			Date date = new Date(); // 获取一个Date对象
			DateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 创建一个格式化日期对象
			DateFormat simpleDateFormat2 = new SimpleDateFormat("yyMMddss");
			String punchTime = simpleDateFormat.format(date); // 格式化后的时间
			String id = simpleDateFormat2.format(date);
			paramUpdateRecord.put("recordTime", punchTime);
			BaseDao.excute(paramUpdateRecord);
			data.put("message", "恭喜您，添加干燥生产记录成功。");
		}
	}

	// http://localhost:8080/addDryRecord.do?deliveryBatch=1&deviceId=1&producerId=1&weightLast=1
	@RequestView(uri = "/production/updateDryRecord", view = "updateDryRecord")
	@ResponseJson
	private void updateDryRecord(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> paramUpdateRecord = getParameterMap(params); // 将数组值转为单个值
		Map<String, Object> paramQueryUser = paramUpdateRecord;
		paramQueryUser.put("view", "getUserById");
		paramQueryUser.put("userId", paramUpdateRecord.get("producerId"));
		User user = (User) BaseDao.excuteQuery(paramQueryUser, User.class);
		try {
			if (paramUpdateRecord.get("name").equals(user.getName())) {
				Date date = new Date(); // 获取一个Date对象
				DateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 创建一个格式化日期对象
				String punchTime = simpleDateFormat.format(date); // 格式化后的时间
				paramUpdateRecord.put("view", "updateDryRecord");
				paramUpdateRecord.put("recordTime", punchTime);
				BaseDao.excute(paramUpdateRecord);
				data.put("message", "恭喜您，修改成功。");
			} else {
				data.put("message", "你填写的员工编号或者员工姓名不是同一个人，请您正确填写。");
			}
		} catch (Exception e) {
			data.put("message", "请你按规定输入正确且完整的数据。");
		}

	}

	@RequestView(uri = "/production/queryDryStandard", view = "queryDryStandard")
	@ResponseJson
	private void queryDryStandard(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		try {
			Map<String, Object> param = getParameterMap(params); // 将数组值转为单个值
			param.put("view", "queryDryStandard");
			List query = (List) BaseDao.excuteQuery(param, null);
			data.put("queryDry", query);
			data.put("type", "干燥");
			data.put("RESULT", Result.SUCCESS);
		} catch (Exception e) {
			data.put("message", "修改失败");
			throw new RuntimeException(e);
		}
	}
	
	@RequestView(uri = "/production/getDryRecord", view = "getDryRecord")
	@ResponseJson
	private void getDryRecord(Map<String, Object[]> params, Map<String, Object> data) throws Exception {

		Map<String, Object> param = getParameterMap(params); // 将数组值转为单个值
		param.put("view", "getDryRecord");
		List<?> query = (List<?>) BaseDao.excuteQuery(param, null);
		data.put("queryDry", query);
		data.put("RESULT", Result.SUCCESS);
	}

	@RequestView(uri = "/production/getStandardByStandarBdId", view = "queryDryStandardDetail")
	@ResponseJson
	private void queryDryStandardDetail(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params); // 将数组值转为单个值
		param.put("view", "queryDryStandardDetail");
		param.put("standerId", param.get("standardId"));
		System.out.println(param.get("standerId"));
		List query = (List) BaseDao.excuteQuery(param, null);
		data.put("standard", query.get(0));
	}

	@RequestView(uri = "/production/dry", view = "getStandardByStandarBdId")
	@Dispatcher(success = "/production/dry", failed = "/error")
	private void drydo(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params); // 将数组值转为单个值
		param.put("standerId", 31);
		List query = (List) BaseDao.excuteQuery(param, null);
		data.put("query", query);
		data.put("message", "cheng");
	}

	@RequestView(uri = "/production/getDryRecordByID", view = "getDryRecordByID")
	@ResponseJson
	private void getDryRecordByID(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params);
		param.put("view", "getDryRecordByID");
		List dryRecord = (List) BaseDao.excuteQuery(param, null);
		if (dryRecord == null) {
			data.put("RESULT", Result.FAILED);
			data.put("message", "记录" + param.get("productBatch") + "不存在");
		} else {
			data.put("RESUTL", Result.SUCCESS);
			data.put("record", dryRecord.get(0));
		}
	}

	@RequestView(uri = "/production/getDryRealTimeDate", view = "getDryRealTimeDate")
	@ResponseJson
	private void getDryRealTimeDate(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params); // 将数组值转为单个值
		DryRealTimeData dryRealTimeData = (DryRealTimeData) BaseDao.excuteQuery(param, DryRealTimeData.class);
		data.put("data_1", dryRealTimeData.getTemperature() * 100);
		data.put("data_2", dryRealTimeData.getWaterContent() * 100);
		data.put("data_3", dryRealTimeData.getFanSpeed() * 100);
		data.put("data_4", dryRealTimeData.getDrumSpeed() * 100);
	}

	@RequestView(uri = "/production/changeRealDry", view = "changeRealDry")
	private void changeRealDry(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params);
		System.out.println(param.get("fanSpeed"));
	}

	@RequestView(uri = "/production/deleteStander", view = "deleteDryStandard")
	@ResponseJson
	private void deleteDryStander(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		System.out.println("Aaaaaaaaaaaaaaaaaaaaaa");
		Map<String, Object> param = getParameterMap(params); // 将数组值转为单个值
		param.put("standerId", "32");
		param.put("view", "getStandardByStandarBdId");
		DryStandard dryStandard = (DryStandard) BaseDao.excuteQuery(param, DryStandard.class);
		param.put("view", "deleteDryStandard");
		BaseDao.excute(param);
		param.put("view", "deleteDryStandard");
		param.put("standarId", dryStandard.getElseId());
		BaseDao.excute(param);
		data.put("message", "删除成功");
		data.put("dryStandard", dryStandard);
	}

	@RequestView(uri = "/production/deleteDryRecord", view = "deleteDryRecord")
	@ResponseJson
	private void deleteDryRecord(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params); // 将数组值转为单个值
		BaseDao.excute(param);
		data.put("message", "删除成功");
	}

	@RequestView(uri = "/production/deleteDryRealTimeDate", view = "deleteDryRealTimeDate")
	@ResponseJson
	private void deleteDryRealTimeDate(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params); // 将数组值转为单个值
		BaseDao.excute(param);
		data.put("message", "删除成功");
	}

	// 打包
	/**
	 * 获取打包阶段的实时数据 根据设备编号id进行收集该设备上的实时数据 参数time为在设置好的某段时间内返回一段实时数据 返回值为boolean类型
	 */
	@RequestView(uri = "/", view = "")
	@ResponseJson
	public void RealPackageData(Map<String, Object[]> params, Map<String, Object> data) {

	}

	/**
	 * 增加打包标准 实现成功返回true,否则返回false
	 * 
	 * @throws Exception
	 */
	@RequestView(uri = "/production/standard/addPackStandard", view = "insertPackageStandard")
	@ResponseJson
	public void insertStandard(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params);// 将数组值转为单个值
		// 判断有没有这个标准,temp里面装了判断是否有这个标准的条件
		Map<String, Object> temp = new HashMap<String, Object>();
		temp.put("leavesType", param.get("leavesType"));
		temp.put("leavesVarieties", param.get("leavesVarieties"));
		temp.put("teaClass", param.get("teaClass"));
		temp.put("view", "selectPackStandard");// 当要查询的时候就添加一个view在这个带有查询条件的map里面
		PackStandard packStandard = (PackStandard) BaseDao.excuteQuery(temp, PackStandard.class);
		System.out.println(packStandard == null);
		if (packStandard != null) {
			data.put("message", "标准已存在,无法增加!");// 当ajax请求时使用response去接收
			data.put("Result", Result.FAILED);
		} else {
			Map<String, Object> temp2 = new HashMap<String, Object>();
			temp2.put("leavesType", param.get("leavesType"));
			temp2.put("leavesVarieties", param.get("leavesVarieties"));
			temp2.put("teaClass", param.get("teaClass"));
			temp2.put("view", "selectTeaCategory");
			TeaCategory teaCategory = (TeaCategory) BaseDao.excuteQuery(temp2, TeaCategory.class);
			if (teaCategory == null) {
				data.put("failed", Result.FAILED);
				data.put("message", "没有该茶种,请输入仓库中已存在的茶种!");
			} else {
				// 如果存在该茶种且没有添加这个标准
				StringBuilder str = new StringBuilder();//定义变长字符串
				Random random = new Random();
				//随机生成数字，并添加到字符串
				for(int i = 0; i < 8; i++){
				    str.append(random.nextInt(10));
				}
				int number = Integer.parseInt(str.toString());
				String standardId = "3" + number;
				
				param.remove("leavesType");
				param.remove("leavesVarieties");
				param.remove("teaClass");
				param.put("teaId", teaCategory.getTeaId());
				param.put("standardId", standardId);
				int query = BaseDao.excute(param);
				if (query > 0) {
					data.put("message", "打包标准添加成功");
					data.put("Result", Result.SUCCESS);
				} else {
					data.put("message", "打包标准添加失败");
					data.put("Result", Result.FAILED);
				}
			}

		}
	}

	/**
	 * 查询打包记录 返回值为list,没有查询结果则返回null
	 * 
	 * @throws Exception
	 */
	@RequestView(uri = "/production/record/getPackRecord", view = "getPackRecord")
	@ResponseJson
	public void getPackRecord(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params);
		param.put("view", "getPackRecord");
		Object object = BaseDao.excuteQuery(param, PackRecord.class);
		if (object instanceof List) {
			List list = (List) object;
			data.put("PackRecordList", list);
			data.put("queryPack", list);
		} else if (object instanceof PackRecord) {
			List<PackRecord> list = new ArrayList<>();
			PackRecord packRecord = (PackRecord) object;
			list.add(packRecord);
			data.put("queryPack", list);
		} else {// 查询无结果
			data.put("message", "查询无结果");
			data.put("Result", Result.FAILED);
			data.put("queryPack", null);
		}
	}

	/**
	 * 根据打包生产批次查询打包生产记录
	 * 
	 * @param params
	 * @param data
	 * @throws Exception
	 */
	@RequestView(uri = "/production/record/getPackRecordByOperateBatch", view = "getPackRecordByOperateBatch") // 第一个参数为前端请求URI,第二个参数对应sql.xml里的view中的name属性
	@ResponseJson
	private void getPackRecordByProductBatch(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params);
		param.put("view", "getPackRecordByOperateBatch");
		PackRecord packRecord = (PackRecord) BaseDao.excuteQuery(param, PackRecord.class);
		if (packRecord == null) {
			data.put("RESULT", Result.FAILED);
			data.put("message", "查找的记录不存在");
		} else {
			data.put("RESUTL", Result.SUCCESS);
			data.put("record", packRecord);
		}
	}

	/**
	 * 查询打包标准
	 * 
	 * @throws Exception
	 */
	@RequestView(uri = "/production/standard/getPackStandard", view = "getPackStandard")
	@Dispatcher(success = "/production/package", failed = "/production/control")
	public void getPackStandard(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params);
		System.out.println(param);
		PackStandardVo packStandardVo = (PackStandardVo) BaseDao.excuteQuery(param, PackStandardVo.class);
		data.put("standard", packStandardVo);
		data.put("message", "查询成功");
		data.put("RESULT", Result.SUCCESS);// 要配置这个表示业务实现成功，不然转发不了
	}

	/**
	 * 查询生产打包标准
	 * 
	 * @throws Exception
	 */
	@RequestView(uri = "/production/standard/getStandardByPackStandardId", view = "getStandardByPackStandardId")
	@ResponseJson
	public void getStandardByPackStandardId(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params);
		param.put("view", "getStandardByPackStandardId");
		PackStandardVo packStandardVo = (PackStandardVo) BaseDao.excuteQuery(param, PackStandardVo.class);
		if (packStandardVo == null) {
			data.put("message", "详情显示失败");
			data.put("Result", Result.FAILED);
		} else {
			SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
			String date = simpleDateFormat.format(new Date());
			packStandardVo.setLastModifyTime(date);
			data.put("standard", packStandardVo);
		}
	}

	/**
	 * 修改打包标准 实现成功返回true,否则返回false
	 * 
	 * @throws Exception
	 */
	@RequestView(uri = "/production/standard/updatePackStandard", view = "updatePackStandard")
	@ResponseJson
	public void updatePackageStandard(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params);// 将数组值转为单个值
		int excute = BaseDao.excute(param);
		if (excute > 0) {
			data.put("message", "标准修改成功");
		} else {
			data.put("Result", Result.FAILED);
			data.put("message", "标准修改失败");
		}
	}

	/**
	 * 增加打包记录 params 前端传来的参数 data 返回给前端的参数
	 * 
	 * @throws Exception
	 */
	@RequestView(uri = "/production/record/addPackRecord", view = "addPackRecord")
	@ResponseJson
	public void getAllStandard(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params);// 将数组值转为单个值
		SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		String date = simpleDateFormat.format(new Date());
		param.put("recordTime", date);
		int excute = BaseDao.excute(param);
		if (excute > 0) {
			data.put("message", "打包记录添加成功");
		} else {
			data.put("message", "打包记录添加失败，请重试");
			data.put("Result", Result.FAILED);
		}
	}

	@RequestView(uri = "/production/standard/deletePackStander", view = "deletePackStandard")
	@ResponseJson
	private void deleteStander(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params); // 将数组值转为单个值

	}

	@RequestView(uri = "/production/record/deletePackRecord", view = "deletePackRecord")
	@ResponseJson
	private void deletePackRecord(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params); // 将数组值转为单个值
		BaseDao.excute(param);
		data.put("message", "删除成功");
	}

	// 传输模块
	/**
	 * 查看传输标准
	 * 
	 * @throws Exception
	 */
	@RequestView(uri = "/production/transport/getTranStandard", view = "getTranStandard")
	@ResponseJson
	public void getTransportStandard(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params);
		TransportStandardVo transportStandardVo = (TransportStandardVo) BaseDao.excuteQuery(param,
				TransportStandardVo.class);
		if (transportStandardVo == null) {
			data.put("message", param.get("deviceId") + "设备参数查询失败，请重试");
			data.put("Result", Result.FAILED);
		} else {
			data.put("TransportStandardVo", transportStandardVo);
			data.put("Result", Result.SUCCESS);
		}
	}

	/**
	 * 修改传输标准
	 * 
	 * @throws Exception
	 */
	@RequestView(uri = "/production/transport/updateTranStandard", view = "updateTranStandard")
	@ResponseJson
	public void updateTranStandard(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params);
		int execute = BaseDao.excute(param);
		if (execute > 0) {
			data.put("message", "传输标准修改成功");
		} else {
			data.put("Result", Result.FAILED);
			data.put("message", "传输标准修改失败");
		}
	}

	/**
	 * 删除传输标准
	 * 
	 * @throws Exception
	 */
	@RequestView(uri = "/production/transport/deleteTranStandard", view = "deleteTranStandard")
	@ResponseJson
	public void deleteTranStandard(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params);
		int execute = BaseDao.excute(param);
		if (execute > 0) {
			data.put("message", "传输标准删除成功");
		} else {
			data.put("Result", Result.FAILED);
			data.put("message", "传输标准删除失败");
		}
	}

	/**
	 * 增加传输标准
	 * 
	 * @throws Exception
	 */
	@RequestView(uri = "/production/transport/addTranStandard", view = "addTranStandard")
	@ResponseJson
	public void addTranStandard(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		Map<String, Object> param = getParameterMap(params);
		int execute = BaseDao.excute(param);
		if (execute > 0) {
			data.put("message", "传输标准增加成功");
		} else {
			data.put("Result", Result.FAILED);
			data.put("message", "传输标准增加失败");
		}
	}

	/**
	 * 获取传输实时数据
	 * 
	 * @param params
	 * @param data
	 */
	@RequestView(uri = "/production/pack/RealTransportData", view = "")
	@ResponseJson
	public void RealTransportData(Map<String, Object[]> params, Map<String, Object> data) {
		// 暂无
	}

	@RequestView(uri = "/production/queryPackStandard", view = "queryPackStandard")
	@ResponseJson
	private void queryPackStandard(Map<String, Object[]> params, Map<String, Object> data) throws Exception {
		try {
			Map<String, Object> param = getParameterMap(params); // 将数组值转为单个值
			param.put("view", "queryPackStandard");
			List query = (List) BaseDao.excuteQuery(param, null);
			
			data.put("queryPack", query);
			data.put("RESULT", Result.SUCCESS);
		} catch (Exception e) {
			data.put("message", "修改失败");
			throw new RuntimeException(e);
		}
	}
	
}